Integrand size = 34, antiderivative size = 86 \[ \int \cot (c+d x) \sqrt {a+i a \tan (c+d x)} (A+B \tan (c+d x)) \, dx=-\frac {2 \sqrt {a} A \text {arctanh}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {a}}\right )}{d}+\frac {\sqrt {2} \sqrt {a} (A-i B) \text {arctanh}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {2} \sqrt {a}}\right )}{d} \]
[Out]
Time = 0.27 (sec) , antiderivative size = 86, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.176, Rules used = {3681, 3561, 212, 3680, 65, 214} \[ \int \cot (c+d x) \sqrt {a+i a \tan (c+d x)} (A+B \tan (c+d x)) \, dx=\frac {\sqrt {2} \sqrt {a} (A-i B) \text {arctanh}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {2} \sqrt {a}}\right )}{d}-\frac {2 \sqrt {a} A \text {arctanh}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {a}}\right )}{d} \]
[In]
[Out]
Rule 65
Rule 212
Rule 214
Rule 3561
Rule 3680
Rule 3681
Rubi steps \begin{align*} \text {integral}& = \frac {A \int \cot (c+d x) (a-i a \tan (c+d x)) \sqrt {a+i a \tan (c+d x)} \, dx}{a}+(i A+B) \int \sqrt {a+i a \tan (c+d x)} \, dx \\ & = \frac {(a A) \text {Subst}\left (\int \frac {1}{x \sqrt {a+i a x}} \, dx,x,\tan (c+d x)\right )}{d}+\frac {(2 a (A-i B)) \text {Subst}\left (\int \frac {1}{2 a-x^2} \, dx,x,\sqrt {a+i a \tan (c+d x)}\right )}{d} \\ & = \frac {\sqrt {2} \sqrt {a} (A-i B) \text {arctanh}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {2} \sqrt {a}}\right )}{d}-\frac {(2 i A) \text {Subst}\left (\int \frac {1}{i-\frac {i x^2}{a}} \, dx,x,\sqrt {a+i a \tan (c+d x)}\right )}{d} \\ & = -\frac {2 \sqrt {a} A \text {arctanh}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {a}}\right )}{d}+\frac {\sqrt {2} \sqrt {a} (A-i B) \text {arctanh}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {2} \sqrt {a}}\right )}{d} \\ \end{align*}
Time = 1.11 (sec) , antiderivative size = 79, normalized size of antiderivative = 0.92 \[ \int \cot (c+d x) \sqrt {a+i a \tan (c+d x)} (A+B \tan (c+d x)) \, dx=\frac {\sqrt {a} \left (-2 A \text {arctanh}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {a}}\right )+\sqrt {2} (A-i B) \text {arctanh}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {2} \sqrt {a}}\right )\right )}{d} \]
[In]
[Out]
Time = 0.37 (sec) , antiderivative size = 72, normalized size of antiderivative = 0.84
method | result | size |
derivativedivides | \(\frac {2 a \left (-\frac {\left (i B -A \right ) \sqrt {2}\, \operatorname {arctanh}\left (\frac {\sqrt {a +i a \tan \left (d x +c \right )}\, \sqrt {2}}{2 \sqrt {a}}\right )}{2 \sqrt {a}}-\frac {A \,\operatorname {arctanh}\left (\frac {\sqrt {a +i a \tan \left (d x +c \right )}}{\sqrt {a}}\right )}{\sqrt {a}}\right )}{d}\) | \(72\) |
default | \(\frac {2 a \left (-\frac {\left (i B -A \right ) \sqrt {2}\, \operatorname {arctanh}\left (\frac {\sqrt {a +i a \tan \left (d x +c \right )}\, \sqrt {2}}{2 \sqrt {a}}\right )}{2 \sqrt {a}}-\frac {A \,\operatorname {arctanh}\left (\frac {\sqrt {a +i a \tan \left (d x +c \right )}}{\sqrt {a}}\right )}{\sqrt {a}}\right )}{d}\) | \(72\) |
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 447 vs. \(2 (65) = 130\).
Time = 0.26 (sec) , antiderivative size = 447, normalized size of antiderivative = 5.20 \[ \int \cot (c+d x) \sqrt {a+i a \tan (c+d x)} (A+B \tan (c+d x)) \, dx=\frac {1}{2} \, \sqrt {2} \sqrt {\frac {{\left (A^{2} - 2 i \, A B - B^{2}\right )} a}{d^{2}}} \log \left (-\frac {4 \, {\left ({\left (-i \, A - B\right )} a e^{\left (i \, d x + i \, c\right )} - {\left (i \, d e^{\left (2 i \, d x + 2 i \, c\right )} + i \, d\right )} \sqrt {\frac {{\left (A^{2} - 2 i \, A B - B^{2}\right )} a}{d^{2}}} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}}\right )} e^{\left (-i \, d x - i \, c\right )}}{i \, A + B}\right ) - \frac {1}{2} \, \sqrt {2} \sqrt {\frac {{\left (A^{2} - 2 i \, A B - B^{2}\right )} a}{d^{2}}} \log \left (-\frac {4 \, {\left ({\left (-i \, A - B\right )} a e^{\left (i \, d x + i \, c\right )} - {\left (-i \, d e^{\left (2 i \, d x + 2 i \, c\right )} - i \, d\right )} \sqrt {\frac {{\left (A^{2} - 2 i \, A B - B^{2}\right )} a}{d^{2}}} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}}\right )} e^{\left (-i \, d x - i \, c\right )}}{i \, A + B}\right ) - \frac {1}{2} \, \sqrt {\frac {A^{2} a}{d^{2}}} \log \left (\frac {16 \, {\left (3 \, A a^{2} e^{\left (2 i \, d x + 2 i \, c\right )} + A a^{2} + 2 \, \sqrt {2} {\left (a d e^{\left (3 i \, d x + 3 i \, c\right )} + a d e^{\left (i \, d x + i \, c\right )}\right )} \sqrt {\frac {A^{2} a}{d^{2}}} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}}\right )} e^{\left (-2 i \, d x - 2 i \, c\right )}}{A}\right ) + \frac {1}{2} \, \sqrt {\frac {A^{2} a}{d^{2}}} \log \left (\frac {16 \, {\left (3 \, A a^{2} e^{\left (2 i \, d x + 2 i \, c\right )} + A a^{2} - 2 \, \sqrt {2} {\left (a d e^{\left (3 i \, d x + 3 i \, c\right )} + a d e^{\left (i \, d x + i \, c\right )}\right )} \sqrt {\frac {A^{2} a}{d^{2}}} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}}\right )} e^{\left (-2 i \, d x - 2 i \, c\right )}}{A}\right ) \]
[In]
[Out]
\[ \int \cot (c+d x) \sqrt {a+i a \tan (c+d x)} (A+B \tan (c+d x)) \, dx=\int \sqrt {i a \left (\tan {\left (c + d x \right )} - i\right )} \left (A + B \tan {\left (c + d x \right )}\right ) \cot {\left (c + d x \right )}\, dx \]
[In]
[Out]
none
Time = 0.30 (sec) , antiderivative size = 113, normalized size of antiderivative = 1.31 \[ \int \cot (c+d x) \sqrt {a+i a \tan (c+d x)} (A+B \tan (c+d x)) \, dx=-\frac {\sqrt {2} {\left (A - i \, B\right )} \sqrt {a} \log \left (-\frac {\sqrt {2} \sqrt {a} - \sqrt {i \, a \tan \left (d x + c\right ) + a}}{\sqrt {2} \sqrt {a} + \sqrt {i \, a \tan \left (d x + c\right ) + a}}\right ) - 2 \, A \sqrt {a} \log \left (\frac {\sqrt {i \, a \tan \left (d x + c\right ) + a} - \sqrt {a}}{\sqrt {i \, a \tan \left (d x + c\right ) + a} + \sqrt {a}}\right )}{2 \, d} \]
[In]
[Out]
\[ \int \cot (c+d x) \sqrt {a+i a \tan (c+d x)} (A+B \tan (c+d x)) \, dx=\int { {\left (B \tan \left (d x + c\right ) + A\right )} \sqrt {i \, a \tan \left (d x + c\right ) + a} \cot \left (d x + c\right ) \,d x } \]
[In]
[Out]
Time = 8.16 (sec) , antiderivative size = 493, normalized size of antiderivative = 5.73 \[ \int \cot (c+d x) \sqrt {a+i a \tan (c+d x)} (A+B \tan (c+d x)) \, dx=-\frac {2\,A\,\sqrt {a}\,\mathrm {atanh}\left (\frac {16\,A^3\,a^{9/2}\,d\,\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}}{16\,d\,A^3\,a^5+32{}\mathrm {i}\,d\,A^2\,B\,a^5+16\,d\,A\,B^2\,a^5}+\frac {16\,A\,B^2\,a^{9/2}\,d\,\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}}{16\,d\,A^3\,a^5+32{}\mathrm {i}\,d\,A^2\,B\,a^5+16\,d\,A\,B^2\,a^5}+\frac {A^2\,B\,a^{9/2}\,d\,\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}\,32{}\mathrm {i}}{16\,d\,A^3\,a^5+32{}\mathrm {i}\,d\,A^2\,B\,a^5+16\,d\,A\,B^2\,a^5}\right )}{d}+\frac {\sqrt {2}\,\sqrt {-a}\,\mathrm {atan}\left (\frac {4\,\sqrt {2}\,A^3\,{\left (-a\right )}^{9/2}\,d\,\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}}{8\,d\,A^3\,a^5+8{}\mathrm {i}\,d\,A^2\,B\,a^5+24\,d\,A\,B^2\,a^5-8{}\mathrm {i}\,d\,B^3\,a^5}-\frac {\sqrt {2}\,B^3\,{\left (-a\right )}^{9/2}\,d\,\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}\,4{}\mathrm {i}}{8\,d\,A^3\,a^5+8{}\mathrm {i}\,d\,A^2\,B\,a^5+24\,d\,A\,B^2\,a^5-8{}\mathrm {i}\,d\,B^3\,a^5}+\frac {12\,\sqrt {2}\,A\,B^2\,{\left (-a\right )}^{9/2}\,d\,\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}}{8\,d\,A^3\,a^5+8{}\mathrm {i}\,d\,A^2\,B\,a^5+24\,d\,A\,B^2\,a^5-8{}\mathrm {i}\,d\,B^3\,a^5}+\frac {\sqrt {2}\,A^2\,B\,{\left (-a\right )}^{9/2}\,d\,\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}\,4{}\mathrm {i}}{8\,d\,A^3\,a^5+8{}\mathrm {i}\,d\,A^2\,B\,a^5+24\,d\,A\,B^2\,a^5-8{}\mathrm {i}\,d\,B^3\,a^5}\right )\,\left (B+A\,1{}\mathrm {i}\right )\,1{}\mathrm {i}}{d} \]
[In]
[Out]